package com.bbx.flink.demo.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

@Data
public class Student  implements Serializable {

    private static final long serialVersionUID = -7210867403340402648L;
    private String id;
    private String name ;
    private int age;
    private String gender;

    public Student() {
    }

    public Student(String id, String name, int age, String gender) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public Student(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public Student(String id,  int age, String gender) {
        this.id = id;
        this.age = age;
        this.gender = gender;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Student student = (Student) o;
        return age == student.age &&
                Objects.equals(id, student.id) &&
                Objects.equals(name, student.name) &&
                Objects.equals(gender, student.gender);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, age, gender);
    }
}
